%File: ~/OOP/analysis/handler/LagrangeConstraintHandler.tex
%What: "@(#) LagrangeConstraintHandler.tex, revA"

\noindent {\bf Files}   \\
\indent \#include $<\tilde{
}$/analysis/handler/LagrangeConstraintHandler.h$>$  \\ 

\noindent {\bf Class Declaration}  \\
\indent class LagrangeConstraintHandler: public ConstraintHandler  \\

\noindent {\bf Class Hierarchy} \\
\indent MovableObject \\
\indent\indent ConstraintHandler \\
\indent\indent\indent {\bf LagrangeConstraintHandler} \\

\noindent {\bf Description} \\ 
\indent The LagrangeConstraintHandler class is a class which deals with
both single and multi point constraints using the Lagrange
method. This is done by, in addition to creating a DOF\_Group object
for each Node and an FE\_Element for each Element in the Domain,
creating a LagrangeDOF\_Group object and either a LagrangeSP\_FE or a
LagrangeMP\_FE object for each constraint in the Domain. It is these
objects that enforce the constraints by modifying the tangent matrix
and residual vector. \\ 


\noindent {\bf Class Interface} \\
\indent // Constructor \\
\indent {\em LagrangeConstraintHandler(double alphaSP, double
alphaMP);}\\  \\ 
\indent // Destructor \\
\indent {\em virtual~ $\tilde{}$LagrangeConstraintHandler();}\\  \\
\indent // Public Methods\\
\indent {\em virtual int handle(const ID *nodeToBeNumberedLast
=0); } \\ 
\indent {\em virtual void clearAll(void);} \\ \\
\indent {\em int sendSelf(int commitTag, Channel \&theChannel); } \\
\indent {\em int recvSelf(int commitTag, Channel \&theChannel, FEM\_ObjectBroker
\&theBroker); } \\


\noindent {\bf Constructor} \\
\indent {\em LagrangeConstraintHandler(double alphaSp, double alphaMP);}\\ 
The integer {\em HANDLER\_TAG\_LagrangeConstraintHandler} (defined in
$<$classTags.h$>$) is passed to the LagrangeConstraintHandler
constructor. Stores {\em alphaSP} and {\em alphaMP} which are needed
to construct the LagrangeSP\_FE and LagrangeMP\_FE objects in {\em
handle()}. \\

\noindent {\bf Destructor} \\
\indent {\em virtual~ $\tilde{}$LagrangeConstraintHandler();}\\ 
Currently invokes {\em clearAll()}, this will change when {\em
clearAll()} is rewritten. \\

\noindent {\bf Public Methods }\\
\indent {\em virtual int handle(const ID *nodeToBeNumberedLast =0) =0;} \\
Determines the number of FE\_Elements and DOF\_Groups needed from the
Domain (a one to one mappinging between Elements and FE\_Elements,
SP\_Constraints and LagrangeSP\_FEs, MP\_Constraints and LagrangeMP\_FEs and
Nodes and DOF\_Groups). Creates two arrays of pointers to store the
FE\_Elements and DOF\_Groups, returning a warning message and a $-2$
or $-3$ if not enough memory is available for these arrays. Then the
object will iterate through the Nodes of the Domain, creating a
DOF\_Group for each node and setting the initial id for each dof to
$-2$ or $-3$ if the node identifier is in {\em
nodesToBeNumberedLast}. The object then iterates through the Elements
of the Domain creating a FE\_Element for each Element, if the Element
is a Subdomain {\em setFE\_ElementPtr()} is invoked on the Subdomain
with the new FE\_Element as the argument. If not enough memory is
available for any DOF\_Group or FE\_element a warning message is
printed and a $-4$ or $-5$ is returned. 
The object then iterates through the SP\_Constraints
of the Domain creating a LagrangeSP\_FE for each constraint, using the
Domain, the constraint and {\em alphaSP} as the arguments in the
constructor.
The object then iterates through the MP\_Constraints
of the Domain creating a LagrangeMP\_FE for each constraint, using the
Domain, the constraint and {\em alphaMP} as the arguments in the constructor.
Finally the method returns the
number of degrees-of-freedom associated with the DOF\_Groups in {\em
nodesToBeNumberedLast}. \\

{\em virtual void clearAll(void) =0;} \\
Currently this invokes delete on all the FE\_element and DOF\_Group
objects created in {\em handle()} and the arrays used to store
pointers to these objects. FOR ANALYSIS INVOLVING DYNAMIC LOAD
BALANCING, RE-MESHING AND CONTACT THIS MUST CHANGE. \\

{\em int sendSelf(int commitTag, Channel \&theChannel); } \\
Sends in a Vector of size 2 {\em alphaSP} and {\em alphaMP}. Returns
$0$ if successful. \\

{\em int recvSelf(int commitTag, Channel \&theChannel, FEM\_ObjectBroker
\&theBroker); } \\
Receives in a Vector of size 2 the values {\em alphaSP} and {\em
alphaMP}. Returns $0$ if successful. 